package com.project.srtp.secure.dao.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author 曹行阳
 * @version 0.1
 * @date 2025/6/16 13:28
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_decryption_sender_key")
public class DecryptionSenderKeyDO {
    private String senderKey;
    private Long preKeyId;
    private Long identityKeyId;
    private String partyId;
    private String sessionId;
    private String ofUserId;
    private String forUserId;
    private String ofOneTimeId;
    private String forOneTimeId;
    private LocalDateTime dtTimeStamp;

    @Override
    public String toString() {
        if(this.ofOneTimeId.isEmpty()) {
            return ofUserId + ":" + forUserId + ":" + sessionId;
        } else {
            return ofOneTimeId + ":" + forOneTimeId + ":" + sessionId;
        }
    }
}
